<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function myCall(fn,thisArg,...args){
        let globalObj = (()=>{
            if (globalThis !== undefined) return globalThis
            if (window !== undefined) return window
            if (global !== undefined) return global
            throw new Error('全局对象不存在')
        })()
        thisArg = thisArg !== null && thisArg !== undefined ? thisArg : globalObj

        const key = Symbol('tempFunKey')
        thisArg[key] = fn
        let result = thisArg[key](...args)
        delete thisArg[key]
        return result
    }
</script>
</html>